package org.aynu.parkingservice.common;

import lombok.Getter;

/**
 * 停车状态代码
 *
 * @author 小粥
 * @since 2025/03/03
 */

@Getter
public enum ParkingStatusCode {
    SUCCESS(200, "请求成功"),
    CREATE_PARKING_SUCCESS(200, "车位创建成功"),
    PARKING_FOUND(200, "车位查询成功"),
    FAILURE(400, "请求失败"),
    CREATE_PARKING_FAILURE(400, "车位创建失败"),
    PARKING_NOT_FOUND(400, "未找到对应车位"),
    BAD_REQUEST(400, "无效请求"),
    EXCEPTION(500, "服务器异常"),

    SELECT_PARKING_SUCCESS(200, "查询所有车位成功"),
    SELECT_AVAILABLE_PARKING_SUCCESS(200, "查询可用车位成功"),
    CREATE_RESERVATION_SUCCESS(200, "预约车位成功"),
    CANCEL_RESERVATION_SUCCESS(200, "取消预约成功"),
    UPDATE_PARKING_SUCCESS(200, "更新车位信息成功"),
    DELETE_PARKING_SUCCESS(200, "删除车位成功"),

    SELECT_PARKING_FAILURE(400, "查询所有车位失败"),
    SELECT_AVAILABLE_PARKING_FAILURE(400, "查询可用车位失败"),
    CREATE_RESERVATION_FAILURE(400, "预约车位失败"),
    CANCEL_RESERVATION_FAILURE(400, "取消预约失败"),
    UPDATE_PARKING_FAILURE(400, "更新车位信息失败"),
    DELETE_PARKING_FAILURE(400, "删除车位失败"),

    PARKING_ALREADY_RESERVED(400, "车位已被预约"),
    RESERVATION_NOT_FOUND(400, "未找到预约信息");
    public static final String ParkingStatus_available = "可用";
    public static final String ParkingStatus_occupied = "占用中";
    public static final String ReserStatus_active = "进行中";
    public static final String ReserStatus_completed = "已完成";
    public static final String ReserStatus_cancelled = "已取消";




    private final int code;
    private final String message;

    /**
     * 停车状态代码
     *
     * @param code    法典
     * @param message 消息
     * @author 小粥
     * @since 2025/03/03
     */

    ParkingStatusCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

}
